<div class="modal-header">
  <div class="modal-title">权限分配</div>
</div>
<div nz-row [nzGutter]="16">
  <div nz-col [nzMd]="8">
    <nz-input-group [nzSuffix]="suffixIcon">
      <input type="text" nz-input placeholder="输入关键字进行过滤" [(ngModel)]="searchValue">
    </nz-input-group>
    <div style="max-height: 450px; overflow-y: auto">

      <nz-tree #nzTree
        [(ngModel)]="menus"
        [nzSearchValue]="searchValue"
        [nzCheckable]="true"
        [nzDefaultExpandAll]="true"
        [nzCheckStrictly]="true"
        [nzDefaultCheckedKeys]="defaultCheckList"
        (nzExpandChange)="mouseAction('expand',$event)"
        (nzClick)="mouseAction('click',$event)"
        (nzOnDragStart)="mouseAction('dragstart',$event)"
        (nzOnDragEnter)="mouseAction('enter',$event)"
        (nzOnDragLeave)="mouseAction('leave', $event)"
        (nzOnDrop)="mouseAction('drop', $event)"
        (nzOnDragEnd)="mouseAction('end', $event)">
        <ng-template #nzTreeTemplate let-node>
          <span class="ant-tree-node-content-wrapper  ng-star-inserted" [class.ant-tree-node-selected]="node.isSelected" style="width: 70.365675%">
            <span class="ant-tree-title">{{node.title}}</span>
            <span style="float: right;">
              <span nz-tooltip nzTitle="选中当前节点和所有下级节点">
                <a href="javascript:void(0)" (click)="selectChildren(node)"><i class="anticon anticon-check-circle"></i></a>
              </span>
              <span nz-tooltip nzTitle="取消选中当前节点和所有下级节点">
                <a href="javascript:void(0)" (click)="unSelectChildren(node)" style="margin-left: 8px;"><i class="anticon anticon-close-circle"></i></a>
              </span>
            </span>
          </span>
        </ng-template>
      </nz-tree>
    </div>
  </div>
  <div nz-col [nzMd]="16">
    <button *ngIf="elementBtn" nz-button nzType="default" type="button" (click)="selectAll()"><i class="anticon anticon-check-square-o"></i>全选</button>
    <button *ngIf="elementBtn" nz-button nzType="default" type="button" (click)="unSelectAll()"><i class="anticon anticon-minus-square-o"></i>全不选</button>
    <simple-table #st
      style="margin-top: 4px;"
      [columns]="columns"
      [data]="url"
      [extraParams]="q"
      [resReName]="{ total: 'data.total', list: 'data.rows' }"
      [reqReName]="{ pi:'pageNumber', ps: 'pageSize' }"
      [toTopInChange]="false"
      [showTotal]="false"
      [showPagination]="false"
      [preDataChange]="dataChange"
      >
      <ng-template st-row="check" let-i>
        <label *ngIf="elementBtn" nz-checkbox [(ngModel)]="i.checked" (ngModelChange)="selectOne(i)"></label>
      </ng-template>
    </simple-table>
  </div>
</div>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
  <button *ngIf="authMenuBtn" nz-button type="button" [nzType]="'primary'" (click)="save()">确定</button>
</div>


<ng-template #suffixIcon>
  <i class="anticon anticon-search"></i>
</ng-template>
